﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteAdmin.Master" Inherits="System.Web.Mvc.ViewPage<Beeldbankmvc.ViewModels.CollectionViewModel>" %>

<%@ Import Namespace="Beeldbankmvc.Code" %>
<%@ Import Namespace="Beeldbankmvc.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">Thema overzicht</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% Html.RenderAction("AdminMenu", "Miscellaneous"); %>
    <h2>Thema overzicht</h2>
    <p>
        <a href="<%= Url.Action("Create", "Collection") %>">
            <img src="<%=AppHelper.getContent("~/Content/images/add.gif") %>" alt="Voeg thema toe" />
            Voeg nieuw thema toe </a>
    </p>
    <table width="100%" class="winkelwagen" summary="Dit is een overzicht van thema's in het beeldarchief">
        <thead>
            <tr>
                <th>
                </th>
                <th>
                    Naam
                </th>
                <th>
                    Omschrijving
                </th>
                <th>
                    Trefwoorden
                </th>
            </tr>
        </thead>
        <tbody>
            <% foreach (BEELDBANK_COLLECTION collection in Model.collectionObjects)
               { %>
            <tr>
                <td>
                    <table>
                        <tr style="white-space: nowrap">
                            <td style="white-space: nowrap">
                                <a href="<%= Url.Action("Edit", "Collection", new RouteValueDictionary(new { id = collection.Id })) %>">
                                    <img src="<%=AppHelper.getContent("~/Content/images/edit.gif") %>" alt="Wijzig thema" />
                                </a>
                            </td>
                            <td style="white-space: nowrap">
                                <% using (Html.BeginForm("Delete", "Collection", new { id = collection.Id }))
                                   { %>
                                <input alt="Verwijder thema" type="image" src="<%=AppHelper.getContent("~/Content/images/delete.gif") %>" onclick="javascript:return confirm('Wilt u dit thema verwijderen?');" />
                                <% } %>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <%=Url.Image<Beeldbankmvc.Controllers.CollectionController>(c => c.DisplayTheme(collection.Id), 50)%>
                            </td>
                        </tr>
                    </table>
                </td>
                <td style="white-space: nowrap">
                    <%: collection.Name %>
                </td>
                <td style="width: 50%">
                    <%: collection.Description %>
                </td>
                <td style="width: 50%">
                    <%: collection.Keywords.Replace("|"," ") %>
                </td>
            </tr>
            <% } %>
        </tbody>
    </table>
</asp:Content>
